package com.letoken.platform.admin.enums;

public enum EnumOrderStatus {
    STATUS_0(0,false,false,"待支付"),
    STATUS_1(1,true,false,"待发货"),
    STATUS_2(2,true,true,"待收货"),
    STATUS_3(3,false,false,"已完成"),
    STATUS_4(4,false,false,"已关闭"),
    STATUS_99(99,false,false,"");

    private Integer code;

    // 是否允许退款申请
    private Boolean refundAmount;
    // 是否允许退货申请
    private Boolean refundGoods;

    private String msg;

    public Integer getCode() {
        return code;
    }

    public Boolean getRefundAmount() {
        return refundAmount;
    }

    public Boolean getRefundGoods() {
        return refundGoods;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    EnumOrderStatus(Integer code,Boolean refundAmount,Boolean refundGoods, String msg) {
        this.code = code;
        this.refundAmount = refundAmount;
        this.refundGoods = refundGoods;
        this.msg = msg;
    }

    public static EnumOrderStatus getInstance(Integer code){
        EnumOrderStatus cause = EnumOrderStatus.valueOf("STATUS_" + code);
        return cause == null ? STATUS_99 : cause;
    }


}
